<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:p="http://primefaces.org/ui">

<p:panel style="border: none;">
	<h:panelGrid columns="3" cellpadding="2" style="border: 2px;">
		<h:outputText value="Condicao" />
		<h:outputText value="parcelas" />
		<h:outputText value="" />

		<p:inputText value="#{beanCondicao.filtro.descricao}" maxlength="4"
			size="7" />
		<p:inputText value="#{beanCondicao.filtro.numero}" size="78" />
		<p:commandButton value="Buscar" icon="ui-icon-search"
			action="#{beanCondicao.find}" update="popCondicaoTabelaCondicao" />
	</h:panelGrid>

	<br></br>
	<p:separator />

	<p:dataTable value="#{beanCondicao.condicoes}" var="condicao"
		id="popCondicaoTabelaCondicao">
		<p:column headerText="Codigo" width="40">
			<h:outputText value="#{condicao.id}" />
		</p:column>

		<p:column headerText="Condicao">
			<h:outputText value="#{condicao.descricao}" />
		</p:column>

		<p:column headerText="Parcelas" width="40">
			<h:outputText value="#{condicao.numero}" />
		</p:column>

		<p:column headerText="Selecionar" width="10">
			<p:commandButton id="selectCond"
				update=":form:pmFornCondicao, :form:pmFornIdCondicao"
				oncomplete="dCondicaoFornecedor.hide()" icon="ui-icon-circle-check"
				title="selecionar">
				<f:setPropertyActionListener value="#{condicao}"
					target="#{beanFornecedor.fornecedor.condPagamento}" />
			</p:commandButton>
		</p:column>
	</p:dataTable>

	<p:separator />
	<br></br>

	<h:panelGrid columns="2">
		<p:commandButton value="Novo" title="Criar Condicao"
			onclick="dManterCondicao.show() ">
		</p:commandButton>
	</h:panelGrid>
</p:panel>

<p:dialog header="Nova Condicao" widgetVar="dManterCondicao"
	id="popManterCondicao" resizable="false">
	<p:panel id="popcondicaoPagamento" style="border: none;">
		<ui:include src="/condPagamento/popManterCondPagamento.xhtml"></ui:include>
	</p:panel>
</p:dialog>


</html>